package com.itheima01.day04;

import java.util.Scanner;

/*
需求：键盘录入5个整数，存储到数组中，并对数组求和

 */
public class ArrayText03 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int[] arr = new int[5];
        int sum = 0;
        for (int i = 0; i < 5; i++) {
            System.out.println("请输入一个整数:");
            arr[i] = sc.nextInt();
            sum += arr[i];
        }
        System.out.println("数组和为:" + sum);
    }
}
